﻿<phone:PhoneApplicationPage x:Class="LuWeibo.Views.LuHomePage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:VM="clr-namespace:LuWeibo.ViewModels"
                            d:DesignHeight="800"
                            d:DesignWidth="480"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            Orientation="Portrait"
                            shell:SystemTray.IsVisible="False"
                            SupportedOrientations="Portrait"
                            mc:Ignorable="d">
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="WeiBoTemplate">
            <StackPanel Width="430"
                        Margin="0,0,0,20"
                        Orientation="Horizontal">
                <Image VerticalAlignment="Top"
                       Source="{Binding user.profile_image_url}"
                       Stretch="None" />
                <StackPanel Width="350">
                    <TextBlock FontWeight="Bold"
                               Foreground="Black"
                               Text="{Binding user.screen_name}" />
                    <TextBlock Foreground="Black"
                               Text="{Binding text}"
                               TextWrapping="Wrap" />
                    <Image HorizontalAlignment="Center"
                           VerticalAlignment="Center"
                           Source="{Binding thumbnail_pic}"
                           Stretch="None" />
                    <StackPanel Width="350" Background="#998B8B8B">
                        <TextBlock Foreground="Black"
                                   Text="{Binding retweeted_status.text}"
                                   TextWrapping="Wrap" />
                        <Image HorizontalAlignment="Center"
                               VerticalAlignment="Center"
                               Source="{Binding retweeted_status.thumbnail_pic}"
                               Stretch="None" />
                    </StackPanel>
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>

    <!--  Panorama-based applications should not show an ApplicationBar  -->

    <phone:PhoneApplicationPage.DataContext>
        <VM:LuHomePageViewModel />
    </phone:PhoneApplicationPage.DataContext>

    <!--  LayoutRoot contains the root grid where all other page content is placed  -->
    <Grid x:Name="LayoutRoot">
        <controls:Panorama>
            <controls:Panorama.Background>
                <ImageBrush ImageSource="/LuWeibo;component/Images/images-panoramabackground.jpg" />
            </controls:Panorama.Background>
            <!--  Panorama item one  -->
            <controls:PanoramaItem>
                <controls:PanoramaItem.Header>
                    <Grid>
                        <Image Source="/Images/cloud.png" Stretch="None" />
                        <TextBlock Text="微博" />
                    </Grid>
                </controls:PanoramaItem.Header>
                <Grid>
                    <i:Interaction.Triggers>
                        <i:EventTrigger>
                            <i:InvokeCommandAction Command="{Binding ShowWeiboCommand, Mode=OneWay}" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                    <Image VerticalAlignment="Bottom" Source="/Images/streetlamp.png" />
                    <ListBox x:Name="WeibosList"
                             ItemsSource="{Binding ShowStatus}"
                             ItemTemplate="{StaticResource WeiBoTemplate}" />
                </Grid>
            </controls:PanoramaItem>

            <!--  Panorama item two  -->
            <controls:PanoramaItem>
                <controls:PanoramaItem.Header>
                    <Grid>
                        <Image Source="/Images/cloud.png" Stretch="None" />
                        <TextBlock Text="评论" />
                    </Grid>
                </controls:PanoramaItem.Header>
                <Grid>
                    <Image VerticalAlignment="Bottom" Source="/Images/streetlamp.png" />
                    <Button x:Name="SearchUserIdBtn"
                            Command="{Binding SearchUserCommand}"
                            Content="查询"
                            Foreground="Black" />
                </Grid>
            </controls:PanoramaItem>
        </controls:Panorama>
    </Grid>

</phone:PhoneApplicationPage>